package com.sumainfor.pc.gmio.controller.tenant;

import com.sumainfor.common.util.FieldCheckUtil;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.impl.tenant.TeWithdrawalEvaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * <p>
 * 租客退租生活费用
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-05-27 13:54
 **/
@Controller
@RequestMapping("/tenant/key/withEva")
public class TeWithdrawalEvaController {

    @Autowired
    TeWithdrawalEvaService teWithdrawalEvaService;

    /**
    * <p>
    * 根据退租账号编号获取退租物品清单
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @GetMapping("/getWithArticleEvaList")
    public JsonResult getWithArticleEvaList(@RequestParam Map<String,Object> params){
        JsonResult result=new JsonResult();
        if(!FieldCheckUtil.isMapFieldNotNull(params,new String[]{"WitId"})){
            result.putFailed("WitId不能为空！");
            return  result;
        }
        if(!FieldCheckUtil.isMapFieldNotNull(params,new String[]{"TenId"})){
            result.putFailed("TenId不能为空！");
            return  result;
        }
        return result.put(teWithdrawalEvaService.getWithArticleEvaList(params));
    }


}
